import argparse, numpy as np, pandas as pd

def wahba_cond(df):
    dirs = np.vstack([df['x'],df['y'],df['z']]).T
    K = dirs.T @ dirs
    return float(np.linalg.cond(K))

if __name__ == "__main__":
    ap = argparse.ArgumentParser()
    ap.add_argument("--check", type=str, required=True)
    args = ap.parse_args()
    df = pd.read_csv(args.check)
    print("cond(K):", wahba_cond(df))
    print("cond(K) 越接近 1 越好，越大说明分布越不均匀")